<%@page import="multiface.promonet.jpa.Utente"%>
<%@page import="javax.persistence.EntityManager"%>
<%@page import="javax.persistence.EntityManagerFactory"%>
<%@page import="multiface.promonet.jpa.util.PersistenceManager"%>
<%@page import="multiface.web.util.Define"%>

<%
    Utente pro;
    if (true) {
        EntityManagerFactory emf = PersistenceManager.getInstance().getEntityManagerFactory();
        EntityManager em = emf.createEntityManager();

        pro = em.find(Utente.class, 1);

        session.setAttribute(Define.USER_SESSION, pro);
        em.close();

    }

    if (pro.getTipo().equalsIgnoreCase(Define.TYPE_USER_PROMOTER)) {%><jsp:include flush="true" page="promoter/index.jsp"></jsp:include><%}
    if (pro.getTipo().equalsIgnoreCase(Define.TYPE_USER_REFERENT)) {%><jsp:include flush="true" page="referente/index.jsp"></jsp:include><%}
    if (pro.getTipo().equalsIgnoreCase(Define.TYPE_USER_ADMIN)) {%><jsp:include flush="true" page="agenzia/index.jsp"></jsp:include><%}
%>